﻿// -----------------------------------------------------------------------------
// 园丁,是个很简单的管理系统
//  gitee:https://gitee.com/hgflydream/Gardener 
//  issues:https://gitee.com/hgflydream/Gardener/issues 
// -----------------------------------------------------------------------------



namespace Gardener.Core.Client.Impl.UserCenter.Pages.TenantConfigView
{

    /// <summary>
    /// 租户配置编辑页
    /// </summary>
    public partial class TenantConfigEdit : EditOperationDialogBase<SystemTenantConfigDto, Int32, UserCenterResource>
    {

        private List<SystemTenantConfigTemplateDto> _templates = new List<SystemTenantConfigTemplateDto>();

        [Inject]
        private ITenantConfigTemplateService tenantConfigTemplateService { get; set; } = null!;
        /// <summary>
        /// 页面初始化后
        /// </summary>
        protected override void OnInitialized()
        {
            base.OnInitialized();
        }

        protected override async Task OnDataLoadingAsync()
        {
            _templates = await tenantConfigTemplateService.GetAllUsable();
            await base.OnDataLoadingAsync();
        }

        private void OnSelectedItemChanged(SystemTenantConfigTemplateDto systemTenantConfigTemplate)
        {
            _editModel.ConfigValue = systemTenantConfigTemplate.DefaultConfigValue;
        }

    }
}
